-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------

-- show default status bar (iOS)
--display.setStatusBar( display.DefaultStatusBar )
display.setStatusBar( display.HiddenStatusBar )
-- include Corona's "widget" library
local widget = require "widget"
local storyboard = require "storyboard"

--play.setStatusBar( display.HiddenStatusBar ) 

--local ads = require "ads"

--local function adListener( event )
--    if event.isError then
        -- Failed to receive an ad.
--    end
--end

--ads.init( "admob", "pub-0176967032816402", adListener )
--ads.show( "banner", { x=0, y=0 } )


-- event listeners for tab buttons:
local function mainView( event )
	storyboard.gotoScene( "view1" )
end

local function shareOnFacebook( event )
	if(sozIndex > 1) then
		sozIndex = sozIndex - 1
	end
	storyboard.gotoScene( "view1" )
end

local function shareOnTwitter( event )
	sozIndex = sozIndex + 1
	storyboard.gotoScene( "view1" )
end


-- create a tabBar widget with two buttons at the bottom of the screen

-- table to setup buttons
local tabButtons = {
--	{ label="Hakkımızda", defaultFile="icon1.png", overFile="icon1-down.png", width = 32, height = 32, onPress=onFirstView, selected=true },
	{ label="Facebook", defaultFile="icon2.png", overFile="icon2-down.png", width = 32, height = 32, onPress=shareOnFacebook },
	{ label="Twitter", defaultFile="icon2.png", overFile="icon2-down.png", width = 32, height = 32, onPress=shareOnTwitter },
}

-- create the actual tabBar widget
--local tabBar = widget.newTabBar{
--	top = display.contentHeight - 50,	-- 50 is default height for tabBar widget
--	buttons = tabButtons
--}

mainView ( mainView )	-- invoke first tab button's onPress event manually